package com.village.zpark.pojo;

import com.village.zpark.common.DateUtil;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;

import javax.persistence.Column;
import javax.persistence.Id;
import javax.persistence.Table;
import java.util.Date;

@Data
@Table(name="affairs")
public class Affairs {
    //事务id
    @Id
    @Column(name="id")
    private Integer id;
    //事务类型
    @Column(name="type")
    private String type;
    //事务标题
    @Column(name="titles")
    private String titles;
    //事务图片
    @Column(name="image")
    private String image;
    //事务描述
    @Column(name="description")
    private String description;
    //事务开始时间
    @Column(name="startdate")
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    private Date startdate;
    //事务结束时间
    @Column(name="enddate")
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    private Date enddate;
    //事务状态
    @Column(name="sates")
    private String sates;
    //事务负责人
    @Column(name="person")
    private String person;
    //事务备注
    @Column(name="remarks")
    private String remarks;
    public String getStartdateStr() {
        return DateUtil.dateConvert(startdate);
    }
    public String getEnddateStr() {
        return DateUtil.dateConvert(enddate);
    }
}
